package com.sntk.organauthomanager.infrastructure.db.repository;

import com.sntk.organauthomanager.infrastructure.db.entity.UserResourceEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserResourceDBRepository extends JpaRepository<UserResourceEntity, Long> {
    List<UserResourceEntity> findAllByUnameAndInstitutionNumber(String uname, String institutionNumber);
    void deleteAllByUname(String uname);
    List<UserResourceEntity> findAllByUname(String uname);
    void deleteAllByUnameAndInstitutionNumber(String uname, String institutionNumber);
    void deleteAllByUnameAndInstitutionNumberNotIn(String uname, List<String> organs);
}
